package com.muqi.app.qlearn.publish;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.muqi.app.qlearn.student.BaseFragmentActivity;
import com.muqi.app.qlearn.student.R;
import com.muqi.app.user.widget.RecordTextEntry;

public class RecordValueDetailAty extends BaseFragmentActivity {
	public static final String RECORD_TITLE = "record_title";
	public static final String RECORD_KEY_ARRAY = "key_array";
	public static final String RECORD_VALUE_ARRAY = "value_array";

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.aty_record_value);
	}

	@Override
	protected void onInit() {
		TextView mTitle = (TextView) findViewById(R.id.value_title);
		String title = getIntent().getStringExtra(RECORD_TITLE);
		mTitle.setText(title + "");
		LinearLayout contentLayout = (LinearLayout) findViewById(R.id.contentLayout);
		String[] key = getIntent().getStringArrayExtra(RECORD_KEY_ARRAY);
		String[] value = getIntent().getStringArrayExtra(RECORD_VALUE_ARRAY);

		if (key != null && value != null) {
			if (key.length != value.length) {
				return;
			}
			for (int i = 0; i < value.length; i++) {
				RecordTextEntry mTextView = new RecordTextEntry(this, key[i], value[i]);
				if (mTextView != null) {
					contentLayout.addView(mTextView);
				}
			}
		}
	}

	@Override
	protected void onData() {
		// TODO Auto-generated method stub
	}

	public void onBack(View v) {
		this.finish();
	}

}
